﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SessionUserControl
{
    /// <summary>
    /// Interaction logic for UserControl1.xaml
    /// </summary>
    public partial class UserControl1 : UserControl
    {
        private string guestName;
        private int hangerNo;

        public UserControl1(string headerTitle, string name, int hangerNo)
        {
            InitializeComponent();
            HeaderTitle = headerTitle;
            lblNameContent = name;
            lblHangerNoContent = hangerNo;
            guestName = name;
            this.hangerNo = hangerNo;
            btnConfirm.Tag = this;
            btnHanger.Tag = this;
            btnCancel.Tag=this;
        }

        public int HangerNo
        {
            get { return hangerNo; }
            set { hangerNo = value; }
        }

        public string GuestName
        {
            get { return guestName; }
            set { guestName = value; }
        }

        public Brush HeaderBackground
        {
            set { stkPnlHeader.Background = value; }
        }

        public Object HeaderTitle
        {
            get { return lblHeader.Content; }
            set { lblHeader.Content = value; }
        }

        public Object lblNameContent
        {
            set { lblName.Content = value; }
        }

        public Object lblHangerNoContent
        {
            set { lblHangerNo.Content = value; }
        }

        public void addEventHandlerToBtnConfirm (RoutedEventHandler handler)
        {
            btnConfirm.Click += handler;
        }

        public void removeEventHandlerFromBtnConfirm(RoutedEventHandler handler)
        {
            btnConfirm.Click -= handler;
        }

        public void addEventHandlerToBtnHanger(RoutedEventHandler handler)
        {
            btnHanger.Click += handler;
        }

        public void removeEventHandlerFromBtnHanger(RoutedEventHandler handler)
        {
            btnHanger.Click -= handler;
        }

        public void addEventHandlerToBtnCancel(RoutedEventHandler handler)
        {
            btnCancel.Click += handler;
        }

        public void removeEventHandlerFromBtnCancel(RoutedEventHandler handler)
        {
            btnCancel.Click -= handler;
        }
   
    }
}
